﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using DAL;
using Model;
using System.Data;

namespace BLL
{
    public class BllStudent
    {
        private DalStudent dal = new DalStudent();

        public bool Create(Student student, out string strMsg)
        {
            bool blnRet = false;
            if (dal.Exists(student.StudNo, out strMsg))
                strMsg = (strMsg.Length > 0) ? strMsg : "创建失败！已有学号： " + student.StudNo;
            else
                blnRet = dal.Create(student, out strMsg);
            return blnRet;
        }

        public bool Delete(Student student, out string strMsg)
        {
            return dal.Delete(student, out strMsg);
        }

        public Student Get(string strStudNo, out string strMsg)
        {
            return dal.Get(strStudNo, out strMsg);
        }

        public List<Student> GetAll(string strWhere, out string strMsg)
        {
            return dal.GetAll(strWhere, out strMsg);
        }

        public bool Update(Student student, out string strMsg)
        {
            return dal.Update(student, out strMsg);
        }

        public DataSet Query(string strWhere, out string strMsg)
        {
            return dal.Query(strWhere, out strMsg);
        }
    }
}
